import request from '@/utils/request'

const userApi = {
  Login: '/boss/passport/login',
  Logout: '/boss/passport/logout',
  UserInfo: '/boss/system/user/pmsInfo',
  reset: '/boss/passport/reset',
  sendCode: '/boss/passport/sendCode'
}

export function getSendCode (parameter) {
  return request({
    url: userApi.sendCode,
    method: 'post',
    data: parameter
  })
}

export function getReset (parameter) {
  return request({
    url: userApi.reset,
    method: 'post',
    data: parameter
  })
}

export function login (parameter) {
  return request({
    url: userApi.Login,
    method: 'post',
    data: parameter
  })
}

export function getInfo (parameter) {
  return request({
    url: userApi.UserInfo,
    method: 'get',
    params: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function logout () {
  return request({
    url: userApi.Logout,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
